<script>
import {userList} from "../../api/user";

export default {
    name: "UserHot",
    data(){
        return{
            userList:[],
            param:{
                current:1,
                size:10,
            }
        }
    },
    methods:{
        getUserList(){
            userList(this.param)
            .then(res=>{
                if(res.code===200){
                    this.userList=res.data.records
                }

            })
        }
    },
    created() {
        this.getUserList()
    }
}
</script>

<template>
    <div class="flex column" style="width: 100%;margin-top: 20px;position: relative">
        <div class="flex row" >
            <div class="font">用户排行</div>
        </div>
        <div class="flex row  align-center" style="padding: 5px 10px;" v-for="(item,i) in userList" :key="i">
            <img :src="item.avatar" alt="" style="width: 40px;padding: 0 20px">
            <div class="flex column">
                <span>{{item.name}}</span>
                <div class="info">
                    222文章 3评论
                </div>
            </div>
        </div>
    </div>
</template>

<style scoped>
.font{
    font-weight: bold;
    font-size: 14pt;
}
.info{
    font-size: 10px;
    color: #3d3d3d;
}

</style>
